import { createStore } from 'vuex'

export default createStore({
  state: {
    userInfo:null,
    showFooter:true,
    showHeader:true,
    user:null
  },
  mutations: {
    SET_USER: (state, v) => {
      state.userInfo = v;
    },
    SET_SHOW_FOOTER: (state, v) => {
      state.showFooter = v;
    },
    SET_SHOW_HEADER: (state, v) => {
      state.showHeader = v;
    },
    setUser:(state,v)=>{
      state.user=v
    }
  },
  actions: {
    setUser: ({commit}, v) => {
      commit('SET_USER', v);
    },
    showFoot: ({commit} ,v)=> {
      commit('SET_SHOW_FOOTER',v)
    },
    showHead: ({commit} ,v)=> {
      commit('SET_SHOW_HEADER',v)
    },
  },
  modules: {
  }
})
